<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<script>
function MultiMenu(value, text, items) {
  this.value = value;
  this.text = text;
  this.items = items;
}

MultiMenu.prototype.getSubMenu = function(value) {
  for (var item of this.items) {
    if (item.value === value) {
      return item;
    }
  }
};

MultiMenu.prototype.getSubNames = function() {
  return this.items.map(function(item) {return item.value;});
};
</script>
